package com.heima.kafka.listener;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class StreamListener {

    @KafkaListener(topics = "heima-stream-result1")
    public void onMessage(ConsumerRecord record) {
        if (record != null) {
            System.out.println("key:" + record.key().toString() +
                    "::" + "value:" + record.value().toString());
        }
    }
}